const mongoose = require('mongoose')
const moment = require('moment')
require('./Class')
const schema = new mongoose.Schema({
    title: {type: String},
    classId: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Class'
    },
    synopsis: {type:String},
    visited: {type:Number,default:0},
    accessPulish_count: {
        type: String,
        default:0,
    },
    text: {type: String},
    status: {
        type:String,
        default:'1'
    },
    created_time:{
        type:String,
        default:moment(new Date()).format('YYYY-MM-DD')
    },
})

module.exports = mongoose.model('Article',schema)
